package com.youlai.boot.factory.model.form;

import java.io.Serial;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;

/**
 * 裁床单表单对象
 *
 * @author youlaitech
 * @since 2025-08-24 14:08
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@Getter
@Setter
@Schema(description = "裁床单表单对象")
public class GarmentCuttingBedForm implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键id")
//    @NotBlank(message = "主键id不能为空")
//    @Size(max=20, message="主键id长度不能超过20个字符")
    @TableId(value = "id", type = IdType.AUTO) // 确保使用 AUTO 策略
    private String id;

    @Schema(description = "床号")
    private String bedNumber;

    @Schema(description = "客户id")
//    @NotBlank(message = "客户id不能为空")
//    @Size(max=50, message="客户id长度不能超过50个字符")
    private String customerId;

    @Schema(description = "款id")
//    @NotBlank(message = "款id不能为空")
//    @Size(max=50, message="款id长度不能超过50个字符")
    private String styleId;

    @Schema(description = "裁床日期")
//    @NotNull(message = "裁床日期不能为空")
    private LocalDate cuttingDate;

    @Schema(description = "员工id")
    @Size(max=50, message="员工id长度不能超过50个字符")
    private String employeeId;

    @Schema(description = "状态(已下单', '已裁好', '已打款)")
    @Size(max=3, message="状态(已下单', '已裁好', '已打款)长度不能超过3个字符")
    private String status;

    @Schema(description = "类型（自裁 外裁）")
    @Size(max=2, message="类型（自裁 外裁）长度不能超过2个字符")
    private String type;

    @Schema(description = "创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "创建人ID")
    private Long createBy;

    @Schema(description = "修改人ID")
    private Long updateBy;

    @Schema(description = "更新时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @Schema(description = "明细列表")
    private List<CuttingBedDetailsForm> details;

    @Schema(description = "总价金额")
    private BigDecimal totalPrice;

    @Schema(description = "单价金额")
    private BigDecimal unitPrice;

    @Schema(description = "计费类型")
    private String chargeType;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "交货日期")
    private LocalDate deliveryDate;
}
